package middlewares

import "github.com/gin-gonic/gin"

func GetCurrentUser(c gin.Context) int {
	empId, exists := c.Get("user")
	if !exists {
		c.JSON(200, gin.H{
			"code": 401,
			"msg":  "Unauthorized",
		})
	}
	return empId.(int)

}
